/******************************************************************************/
/* Files to Include                                                           */
/******************************************************************************/

#if defined(__XC)
    #include <xc.h>         /* XC8 General Include File */
#elif defined(HI_TECH_C)
    #include <htc.h>        /* HiTech General Include File */
#elif defined(__18CXX)
    #include <p18cxxx.h>    /* C18 General Include File */
#endif

#if defined(__XC) || defined(HI_TECH_C)

//#include <stdint.h>         /* For uint8_t definition */
//#include <stdbool.h>        /* For true/false definition */

#endif

#include "app_init.h"
#include "drv_interrupts.h"
#include "drv_tmr.h"
#include "drv_adc.h"
#include "drv_ioports.h"
#include "periodic_task_exec.h"
#include "drv_uart.h"

/******************************************************************************/
/* app_init Functions                                                             */
/******************************************************************************/
/* <Initialize variables in app_init.h and insert code for app_init algorithms.> */


void InitApp(void)
{

    /* TODO Initialize app_init Ports/Peripherals/Project here */

    /* Setup analog functionality and port direction */
    init_ports();
    init_adc();
    /* Initialize peripherals */
    init_uart(19200);
    drv_tmr1_init(MIN_TICK(1));
    //init_pwm();
    //SPPCON = 0x00;
    /* Configure the IPEN bit (1=on) in RCON to turn on/off int priorities */

    /* Enable interrupts */
    init_int();
}

